<?php
require ('../include/init.inc.php');
extract ( $_REQUEST );

if ($id) {
	$module = Phone::getById ( $id );	
}

if (Common::isPost ()) {
	if ($content != null && $content != "") {
		$existCard = "";
		$list = explode("\r\n", $content);
		foreach ($list as $key => $value) {
			$input_data = array ('phone' => $value);

			$result = Phone::add ($input_data);
		}
	} else {
		$input_data = array ('phone' => $phone);

		$result = Phone::add ($input_data);	
	}

	
		
		if ($result>=0) {
			SysLog::addLog ( UserSession::getUserName(), 'MODIFY', 'Module' ,$module_id, json_encode($update_data) );
			Common::exitWithSuccess ('更新完成','panel/phone.php');
		} else {
			OSAdmin::alert("error");
		}
}

Template::assign ( 'module', $module );
Template::assign ( 'view', $view );
Template::display ( 'panel/phone_modify.tpl' );